package executor;

import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledFuture;
import java.util.concurrent.TimeUnit;

/**
 * Created by brossdong on 2018/1/20.
 */

class Temp  extends Thread{
    @Override
    public void run() {
        System.out.println("run:管儿子");
    }
}

public class ScheduledJob{

    public static void main(String[] args) throws Exception{
        Temp temp = new Temp();
        ScheduledExecutorService executorService = Executors.newScheduledThreadPool(1);

        ScheduledFuture<?> scheduler = executorService.scheduleWithFixedDelay(temp,1,3,TimeUnit.SECONDS);
    }

}
